package cn.tedu.store.controller;

import javax.servlet.http.HttpSession;

public abstract class BaseController {
	/**
	 * 根据session取出用户id
	 * @param session
	 * @return 返回用户id
	 */
	protected Integer getUidFromSession(HttpSession session) {
		Object uidObject=session.getAttribute("uid");
		if(uidObject==null) {
			return null;
		}else {
			return Integer.valueOf(uidObject.toString());
		}
	}
}
